﻿import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../components/Layout.vue'
import Dashboard from '../views/Dashboard.vue'
import TicketCreate from '../views/TicketCreate.vue'
import TicketList from '../views/TicketList.vue'
import TicketDetail from '../views/TicketDetail.vue'
import TicketAssign from '../views/TicketAssign.vue'

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '',
        name: 'Dashboard',
        component: Dashboard
      },
      {
        path: 'ticket/create',
        name: 'TicketCreate',
        component: TicketCreate
      },
      {
        path: 'ticket/list',
        name: 'TicketList',
        component: TicketList
      },
      {
        path: 'ticket/detail/:id',
        name: 'TicketDetail',
        component: TicketDetail
      },
      {
        path: 'ticket/assign',
        name: 'TicketAssign',
        component: TicketAssign
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
